Stop passing null as second argument to document.createElement()#6896
Stop passing null as second argument to document.createElement()#6896gaearon merged 2 commits intofacebook:masterfrom
Conversation
|
Can we just always pass cc @jimfb |
|
I tried that, it was my first guess: Firefox helpfully gives you |
|
Haha, got it. Let’s split into two branches to make it a bit easier on eyes? } else if (props.is) {
...
} else {
...
} |
|
Sure thing, done. |
|
Is there any way to test this with jsdom so we don’t regress? |
|
@darobin updated the pull request. |
|
Not that I can think of, at least not without intercepting |
|
Thanks! |
|
Do you know if this Firefox bug been reported to Mozilla? |
|
Yes, I discussed it on #whatwg this morning to double-check, and reported it in bugzilla. |
…ebook#6896) * Stop passing null as second argument to document.createElement() * rewrap check for props.is to make it more readable (cherry picked from commit 2636155)
* Stop passing null as second argument to document.createElement() * rewrap check for props.is to make it more readable (cherry picked from commit 2636155)
When using the two-parameter variant of
document.createElement()(which is used for Custom Elements), ifnullis passed as the second parameter then Firefox will stringify it to the DOM as anis="null"attribute. I don't believe that this causes any manner of problem, but it is surprising (as exemplified in this discussion thread.This change simply changes the call to avoid passing
null.